//开始写入，命名空间不会覆盖
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using Google.Protobuf;
//结束写入，命名空间不会覆盖
namespace TriangleProtocol
{
	public class TriangleProtocolNet : Singleton<TriangleProtocolNet>
	{
		public override void Init()
		{
			base.Init();
			RegisterProtocol();
		}

		public void RegisterProtocol()
		{
			//开始自动生成注册protocol
			NetMgr.Instance.RegisterProtocol<MissionInfoResponse>(30001,MissionInfoResponse_Res);
			NetMgr.Instance.RegisterProtocol<MissionHarvestResponse>(30002,MissionHarvestResponse_Res);
			//结束自动生成注册protocol
		}

		//开始自动生成MissionInfoRequest请求
		/// <summary>
		/// MissionInfoRequest请求
		/// </summary>
		async public void MissionInfoRequest_Req()
		{
			MissionInfoRequest req = new MissionInfoRequest();
			//send protocol
			await NetMgr.Instance.SendProtocol(30001,req);
		}
		//结束自动生成MissionInfoRequest请求
		//开始自动生成MissionHarvestRequest请求
		/// <summary>
		/// MissionHarvestRequest请求
		/// </summary>
		async public void MissionHarvestRequest_Req()
		{
			MissionHarvestRequest req = new MissionHarvestRequest();
			//send protocol
			await NetMgr.Instance.SendProtocol(30002,req);
		}
		//结束自动生成MissionHarvestRequest请求

		//以下是自动生成的响应，不会覆盖手写的代码
		//开始自动生成MissionInfoResponse响应
		/// <summary>

		/// MissionInfoResponse响应
		/// </summary>
		/// <param name="res">
		/// 
		/// </param>
		/// <value>
		/// res.Mission	关卡数据
		/// </value>
		public void MissionInfoResponse_Res(MissionInfoResponse res, int code)
		{
			if(code == 0)
			{
				//TODO
				
			}
		}
		//结束自动生成MissionInfoResponse响应

		//开始自动生成MissionHarvestResponse响应
		/// <summary>

		/// MissionHarvestResponse响应
		/// </summary>
		/// <param name="res">
		/// 
		/// </param>
		/// <value>
		/// res.Mission	关卡数据
		/// </value>
		public void MissionHarvestResponse_Res(MissionHarvestResponse res, int code)
		{
			if(code == 0)
			{
				//TODO
				
			}
		}
		//结束自动生成MissionHarvestResponse响应

	}
}
